{!{MANAGE_PATH}/templates/common/header!}
<style type="text/css">
    .main-navbar-header {
        background: url("/{MANAGE_PATH}/static/images/logo1.png") no-repeat;
        background-position: center;
        background-size: 68%;
    }
</style>

<div class="container-main main-navbar">
    <div class="main-navbar-menu">
        <div class="btn-group">
            <a href="javascript:;" onclick="show_main_menu()" class="main-navbar-toolbar-more-link"><i class="fa fa-bars"></i></a>
        </div>
    </div>
    <div class="main-navbar-header"></div>
    <div class="main-navbar-toolbar">
        <!--<li data-toggle="tooltip" data-placement="bottom" title="系统消息"><i class="fa fa-bell-o"></i></li>
        <li data-toggle="tooltip" data-placement="bottom" title="站内短信"><i class="fa fa-comment-o"></i></li>
        <li data-toggle="tooltip" data-placement="bottom" title="我的收藏"><i class="fa fa-heart-o"></i></li>-->
        <li data-toggle="tooltip" data-placement="bottom" title="个人资料" onclick="_goto('?m=personal&a=chnpwd')"><i class="fa fa-user-o"></i></li>
        <li data-toggle="tooltip" data-placement="bottom" title="注销登录" onclick="_goto('?m=login&a=out')"><i class="fa fa-sign-out"></i></li>
    </div>
    <div class="main-navbar-toolbar-more">
        <div class="btn-group">
            <a href="javascript:;" data-toggle="dropdown" class="main-navbar-toolbar-more-link"><i class="fa fa-ellipsis-h"></i></a>
            <div class="dropdown-menu dropdown-menu-right">
                <!--<a class="dropdown-item" href="#"><i class="fa fa-bell-o"></i> 系统消息</a>
                <a class="dropdown-item" href="#"><i class="fa fa-comment-o"></i> 站内短信</a>
                <a class="dropdown-item" href="#"><i class="fa fa-heart-o"></i> 我的收藏</a>-->
                <a class="dropdown-item" href="javascript:;" onclick="_goto('?m=personal&a=chnpwd')"><i class="fa fa-user-o"></i></i> 个人资料</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="javascript:;" onclick="_goto('?m=login&a=out')"><i class="fa fa-sign-out"></i> 注销登录</a>
            </div>
        </div>
    </div>
</div>
<div class="container-main">
    <div class="menubar">
        <div id="menubar_area1" role="tablist" class="mainmenu_layer_1">
        {main_menu_define}
        </div>
    </div>
    <div id="main_content">Loading ...</div>
</div>
<script type="text/javascript">
    var allow_lastrun = window.localStorage.getItem("allow_lastrun");
    var last_url = "";

    $(document).ready(function () {
        if (top.location != location) top.location.href = location.href;

        if(allow_lastrun == null || allow_lastrun) {
            last_url = window.localStorage.getItem("last_url");
            if(last_url!=null && last_url.length > 0 && last_url != "?m=login&a=out") {
                if(last_url.length) _goto(last_url);
            }
        }
    });

    function _menu_goto(obj, url) {
        $(".menubar *").removeClass("menu_active");
        $(obj).addClass("menu_active");
        _goto(url);
    }

    function _goto_proc(url) {
        $("#main_content").html("<i class=\"fa fa-refresh fa-spin\"></i> Loading ...");
        $.get(url, function (result) {
            setTimeout(function () {
                $("#main_content").html(result);
            },100);
        });
    }

    function _goto(url) {
        _goto_proc(url);

        if(url != "?m=login&a=out") {
            History.push({
                param_url : url,
                param_args : "",
                func : _goto_proc  // 回调函数
            });
            window.localStorage.setItem("last_url", url);
            last_url = url;
        }
    }

    function _refresh_page() {
        _goto(last_url);
    }
    
    function show_main_menu() {
        $(".menubar").toggle(200);
    }
</script>
{!{MANAGE_PATH}/templates/common/footer!}